// Fill out your copyright notice in the Description page of Project Settings.


#include "MeshToOBJExporter.h"

// Sets default values
AMeshToOBJExporter::AMeshToOBJExporter()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void AMeshToOBJExporter::BeginPlay()
{
	Super::BeginPlay();

	//UStaticMesh* MyStaticMesh = NULL;//...; // 获取你的静态网格体
	FString ExportPath = FPaths::ProjectSavedDir() + TEXT("/ExportedMeshes/MyMesh.obj");

	//bool bSuccess = ExportStaticMeshToOBJ(MyStaticMesh, ExportPath, true);
	bool bSuccess = ExportAllStaticMeshesInLevel(ExportPath);

	UE_LOG(LogTemp, Warning, TEXT("%d"), bSuccess);
	
}

// Called every frame
void AMeshToOBJExporter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

